home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextLibrary / Frameworks / NIAccess.framework / Versions / A / Headers / NIDirectory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-07  |  3.3 KB  |  142 lines

  1. /*
  2.     NIDirectory.h
  3.     NetInfo Directory Class
  4.     Copyright (c) 1994, NeXT Computer, Inc.
  5.     All rights reserved.
  6.  */
  7.  
  8. #ifndef STRICT_OPENSTEP
  9.  
  10. #import <objc/objc.h>
  11.  
  12. #import <Foundation/NSArray.h>
  13. #import <Foundation/NSString.h>
  14. #import <Foundation/NSLock.h>
  15. #import <Foundation/NSDictionary.h>
  16. @class NIDomain;
  17.  
  18. @interface NIDirectory : NSObject
  19. {
  20.     @private
  21.     NSMutableDictionary *propertyList;
  22.     NSMutableDictionary *readerList;
  23.     NSMutableDictionary *writerList;
  24.     unsigned int directoryNumber;
  25.     unsigned int directoryVersion;
  26.     unsigned int domainVersion;
  27.     NSMutableArray *readers;
  28.     NSMutableArray * writers;
  29.     NIDomain *domain;
  30.     void *handle;
  31.     NSLock *dirLock;
  32.     NIDirectory *parent;
  33.     id reserved;
  34. }
  35.  
  36. /* 
  37.  * Class Methods
  38.  */
  39.  
  40. /*
  41.  * Directory access
  42.  */
  43. + (NIDirectory *)directoryWithPath:(NSString *)path
  44.     inDomain:(NIDomain *)domain;
  45. + (NIDirectory *)directoryWithNumber:(unsigned)number
  46.     inDomain:(NIDomain *)domain;
  47.  
  48. /*
  49.  * Synchronize with database
  50.  */
  51. - (BOOL)isSynchronized;
  52. - (BOOL)synchronize;
  53.  
  54. /*
  55.  * Directory information
  56.  */
  57. - (NIDomain *)domain;
  58. - (NSString *)name;
  59. - (NSString *)path;
  60. - (unsigned int)directoryNumber;
  61. - (unsigned int)directoryVersion;
  62. - (unsigned int)domainVersion;
  63.  
  64. /*
  65.  * Parent and child directories
  66.  */
  67. - (NIDirectory *)parent;
  68. - (BOOL)hasSubdirectories;
  69. - (unsigned)numberOfSubdirectories;
  70. - (NSArray *)subdirectoryNumbers;
  71. - (NSArray *)subdirectories;
  72. - (NSArray *)subdirectoriesWithKey:(NSString *)aKey;
  73. - (NSArray *)subdirectoriesWithKey:(NSString *)aKey value:(NSString *)aVal;
  74.  
  75. /*
  76.  * Subdirectory keys and values
  77.  */
  78. - (NIDirectory *)subdirectoryWithName:(NSString *)name;
  79. - (NSArray *)subdirectoryKeys;
  80. - (NSArray *)subdirectoryValuesForKey:(NSString *)aKey;
  81.  
  82. /*
  83.  * Add and remove directories.
  84.  */
  85. - (BOOL)destroy;
  86. - (BOOL)attach:(NIDirectory *)aDir;
  87. - (BOOL)attachByCopy:(NIDirectory *)aDir
  88.     recursive:(BOOL)flag;
  89. - (BOOL)detach:(NIDirectory *)aDir;
  90. - (BOOL)createSubdirectory:(NSString *)name;
  91. - (BOOL)createPath:(NSString *)path;
  92.  
  93. /*
  94.  * PropertyList access.
  95.  */
  96. - (BOOL)replacePropertyList:(NSDictionary *)aDict;
  97. - (NSDictionary *)propertyList;
  98.  
  99. /*
  100.  * PropertyList convenience methods.
  101.  */
  102. - (NSArray *)allKeys;
  103. - (NSArray *)valuesForKey:(NSString *)aKey;
  104. - (NSString *)firstValueForKey:(NSString *)aKey;
  105. - (BOOL)hasValue:(NSString *)aVal forKey:(NSString *)aKey;
  106.  
  107. - (BOOL)replaceValues:(NSArray *)aVal forKey:(NSString *)aKey;
  108. - (BOOL)appendValue:(NSString *)aVal forKey:(NSString *)aKey;
  109. - (BOOL)insertValue:(NSString *)aVal
  110.     forKey:(NSString *)aKey
  111.     atIndex:(unsigned)where;
  112.  
  113. - (BOOL)removeValue:(NSString *)aVal forKey:(NSString *)aKey;
  114. - (BOOL)removeValueAtIndex:(unsigned)where forKey:(NSString *)aKey;
  115. - (BOOL)removeKey:(NSString *)aKey;
  116.  
  117. /*
  118.  * Access control lists.
  119.  * Note that read access control has not yet been implemented in the server.
  120.  */
  121. - (NSArray *)readers;
  122. - (NSArray *)writers;
  123.  
  124. - (NSArray *)readersForKey:(NSString *)aKey;
  125. - (NSArray *)writersForKey:(NSString *)aKey;
  126.  
  127. - (BOOL)addReader:(NSString *)userName;
  128. - (BOOL)addWriter:(NSString *)userName;
  129.  
  130. - (BOOL)addReader:(NSString *)userName forKey:(NSString *)aKey;
  131. - (BOOL)addWriter:(NSString *)userName forKey:(NSString *)aKey;
  132.  
  133. - (BOOL)removeReader:(NSString *)userName;
  134. - (BOOL)removeWriter:(NSString *)userName;
  135.  
  136. - (BOOL)removeReader:(NSString *)userName forKey:(NSString *)aKey;
  137. - (BOOL)removeWriter:(NSString *)userName forKey:(NSString *)aKey;
  138.  
  139. @end
  140.  
  141. #endif STRICT_OPENSTEP
  142.